This invention relates to computer application macros.
Most computer applications have macro generators for producing macros or user definable list of actions to perform on an data file. In a typical macro generator, a user enters a macro record mode and can select a sequence of actions to apply to the data file. The sequence of actions (i.e., macro) are stored in a macro file. Actions are added to the macro file until the macro recording is ended by some action of the user. The macro file is typically packaged in the application program and stored in a form that can later be executed by the application program. At a later time, the macro file can be applied to a data file opened in the application program. Macros can be produced to manipulate data within the data file, reformat data in the data file and so forth.
The actions in the macro file are applied to the data file by opening the data file within the application program and executing the macro. Thus, to apply the macro to a series of data files, each of the data files are opened in the application and the macro is applied in turn to each data file.
According to one aspect of the invention, a method of producing a macro for use by an application program includes producing a macro file including at least two versions of executable configuration code corresponding to two different operating systems to interface the macro file to an application program and attaching to the macro file a sequence of actions to apply to an application file produced by the application program. The method also includes attaching application identification information to the macro file that identifies an original host application corresponding to the macro.
The method permits packaging of the sequence of actions into an executable file and inserting a call to the application program into the executable file. The macro file can be stored independent of the application program at an address location outside of the application program address space. The macro file can be stored on a computer storage medium or in a location corresponding to a computer desktop folder such that an icon pointing to the macro file can be displayed on a computer display.
According to a still further aspect of the invention, a computer program product residing on a computer readable medium for producing a macro for use by an application program includes instructions for causing a computer produce a macro file including executable configuration code to interface the macro file to an application program and attach to the macro file a sequence of actions to apply to an application file produced by the application program. The program product also attaches application identification information to the macro file that identifies an original host application corresponding to the macro.
According to another aspect of the invention, a method of applying a macro to a data file associated with an application program includes moving an icon representation of the data file to a macro icon representative of the macro file. In response the macro file cause an execution of a call to the application process. The application process executes and applies a sequence of actions in the macro file to the data file.
The method executes a call by passing a location of the file to the application program and passing the list of operations to the application program. The method can have the application file produced in a first environment. The macro file can include executable configuration code written for the first environment and a second, different environment, and executes the code for the first environment. The method can have the executable code for the first application stored in a data fork structure. If executable code for the first environment requires the executable configuration code stored in a resource fork structure, the method executes the host application, opening the macro file in the host application. The host application will detect that the resource fork data is missing and regenerate the executable code.
According to another aspect of the invention, a data structure stored on a computer readable medium representing a macro file includes a field for executable configuration code for invoking an application program, a field corresponding to an executable call to the application program and a script file corresponding to a list of actions that are applied to an application program file.
The user produces a sequence of actions within an application program and stores the sequence of actions as an executable macro file. The macro file includes an executable macro and sufficient executable information to invoke the original application. An icon corresponding to the executable macro file can be placed on the desktop. Thus, the macro can takes advantage of the so-called drag and drop features common in window-type operating systems. The user can drag any number of data files to the macro icon and the macro file will set up a sequence of operations to call a host application that can apply the actions in the macro to each of the data files. This makes initiation of batch type operation easier.